#include "trap.h"
#include "instr_def.h"
#include "instr_test.h"
    .set noreorder
    .globl main
    .text
main:
    li $k1, 0x0
    nop
    nop
    UNKNOWN
    nop
    nop
    # IntegerOverflow
    ADD_TEST(0x555b05c6, 0x555b05c6, 0x00000000) # 1
    nop
    nop
    ADD_TEST(0x7fffffff, 0x7fffffff, 0x00000000) # 2
    nop
    nop
    ADD_TEST(0x80000000, 0x80000000, 0x00000000) # 3
    nop
    nop
    ADDI_TEST(0x7fffffff, 0x00000000, 0x7fff) # 4
    nop
    nop
    ADDI_TEST(0x80000000, 0x00000000, 0x8000) # 5
    nop
    nop
    ADDI_TEST(0x7fffffff, 0x00000000, 0x1528) # 6
    nop
    nop
    SUB_TEST(0x80613360, 0x42adf91d, 0x00000000) # 7
    nop
    nop
    SUB_TEST(0x8dededee, 0x2dededee, 0x00000000) # 8
    nop
    nop
    SUB_TEST(0xe4b62124, 0x6f1772b8, 0x00000000) # 9
    nop
    nop
    SUB_TEST(0xc9c9c9ca, 0x5dededee, 0x00000000) # 10
    nop
    nop
    SUB_TEST(0x7a19dd40, 0x807971e0, 0x00000000) # 11
    nop
    nop
    li $k1, 0x12345678
    HIT_GOOD_TRAP		# stop temu      

    .org 0x380
IntegerOverflow:
    or $s0, $zero, $zero
    eret # TEST ERROR

res_error: 
    li $s1, 0x11111111
    HIT_BAD_TRAP		# stop temu   